-- up_power
-- create by cheny3
-- 提升下回合威力

return {
    -- 触发
    trigger = function(treeHouse)
        if not treeHouse or not treeHouse:isTreeHouse() then
            trace("TreeHouseM/up_power", "树屋对象错误。\n");
            return false;
        end

        -- 设置树屋威力提升
        local prop = treeHouse.dbase:query("prop", {});
        prop["up_power"] = 1;
        treeHouse.dbase:set("prop", prop);

        return true;
    end,

    -- 清除
    clear =  function(treeHouse)
        if not treeHouse or not treeHouse:isTreeHouse() then
            trace("TreeHouseM/up_power", "树屋对象错误。\n");
            return false;
        end

        local prop = treeHouse.dbase:query("prop");
        if prop and prop["up_power"] then
            -- 删除属性
            prop["up_power"] = nil;
            treeHouse.dbase:set("prop", prop);
        end

        return true;
    end,
};
